Public Class nunit_const

    Public Shared IBANRecords() As IBANTestRecord = _
        {New IBANTestRecord("AD1200012030200359100100", "AD", "12", "0001", "2030", "200359100100"), _
         New IBANTestRecord("AT611904300234573201", "AT", "61", "19043", "", "00234573201"), _
         New IBANTestRecord("BE68539007547034", "BE", "68", "539", "", "007547034"), _
         New IBANTestRecord("HR1210010051863000160", "HR", "12", "1001005", "", "1863000160"), _
         New IBANTestRecord("CY17002001280000001200527600", "CY", "17", "002", "00128", "0000001200527600"), _
         New IBANTestRecord("CZ6508000000192000145399", "CZ", "65", "0800", "", "0000192000145399"), _
         New IBANTestRecord("DK5000400440116243", "DK", "50", "0040", "", "0440116243"), _
         New IBANTestRecord("EE382200221020145685", "EE", "38", "2200", "", "221020145685"), _
         New IBANTestRecord("FI2112345600000785", "FI", "21", "123456", "", "00000785"), _
         New IBANTestRecord("FR1420041010050500013M02606", "FR", "14", "20041", "01005", "0500013M02606"), _
         New IBANTestRecord("DE89370400440532013000", "DE", "89", "37040044", "", "0532013000"), _
         New IBANTestRecord("GI75NWBK000000007099453", "GI", "75", "NWBK", "", "000000007099453"), _
         New IBANTestRecord("GR1601101250000000012300695", "GR", "16", "011", "0125", "0000000012300695"), _
         New IBANTestRecord("HU42117730161111101800000000", "HU", "42", "117", "73016", "1111101800000000"), _
         New IBANTestRecord("IS140159260076545510730339", "IS", "14", "015926", "", "0076545510730339"), _
         New IBANTestRecord("IE29AIBK93115212345678", "IE", "29", "AIBK", "931152", "12345678"), _
         New IBANTestRecord("IT60X0542811101000000123456", "IT", "60", "X05428", "11101", "000000123456"), _
         New IBANTestRecord("LV80BANK0000435195001", "LV", "80", "BANK", "", "0000435195001"), _
         New IBANTestRecord("LT121000011101001000", "LT", "12", "10000", "", "11101001000"), _
         New IBANTestRecord("LI21088100002324013AA", "LI", "21", "08810", "", "0002324013AA"), _
         New IBANTestRecord("LU280019400644750000", "LU", "28", "001", "", "9400644750000"), _
         New IBANTestRecord("MT84MALT011000012345MTLCAST001S", "MT", "84", "MALT", "01100", "0012345MTLCAST001S"), _
         New IBANTestRecord("NL91ABNA0417164300", "NL", "91", "ABNA", "", "0417164300"), _
         New IBANTestRecord("NO9386011117947", "NO", "93", "8601", "", "1117947"), _
         New IBANTestRecord("PL27114020040000300201355387", "PL", "27", "11402004", "", "0000300201355387"), _
         New IBANTestRecord("PT50000201231234567890154", "PT", "50", "0002", "0123", "1234567890154"), _
         New IBANTestRecord("RO49AAAA1B31007593840000", "RO", "49", "AAAA", "", "1B31007593840000"), _
         New IBANTestRecord("SK3112000000198742637541", "SK", "31", "1200", "", "0000198742637541"), _
         New IBANTestRecord("SI56191000000123438", "SI", "56", "19100", "", "0000123438"), _
         New IBANTestRecord("ES9121000418450200051332", "ES", "91", "2100", "04184", "50200051332"), _
         New IBANTestRecord("SE3550000000054910000003", "SE", "35", "500", "", "00000054910000003"), _
         New IBANTestRecord("CH9300762011623852957", "CH", "93", "00762", "", "011623852957"), _
         New IBANTestRecord("GB29NWBK60161331926819", "GB", "29", "NWBK", "601613", "31926819"), _
         New IBANTestRecord("TN5914207207100707129648", "TN", "59", "14", "207", "207100707129648"), _
         New IBANTestRecord("BA391290079401028494", "BA", "39", "129", "007", "9401028494"), _
         New IBANTestRecord("BG80BNBG96611020345678", "BG", "80", "BNBG", "9661", "1020345678"), _
         New IBANTestRecord("MK07300000000042425", "MK", "07", "300", "", "000000042425"), _
         New IBANTestRecord("ME25505000012345678951", "ME", "25", "505", "", "000012345678951"), _
         New IBANTestRecord("RS35260005601001611379", "RS", "35", "260", "", "005601001611379"), _
         New IBANTestRecord("TR330006100519786457841326", "TR", "33", "00061", "", "00519786457841326"), _
         New IBANTestRecord("MU17BOMM0101101030300200000MUR", "MU", "17", "BOMM01", "01", "101030300200000MUR")}

    Public Shared Function FindElementIndex(ByVal countryCode As String) As Integer
        For i As Integer = 0 To IBANRecords.GetUpperBound(0)
            If IBANRecords(i).CountryCode = countryCode Then Return i
        Next
        Return -1
    End Function

End Class

Public Class IBANTestRecord
    Inherits IBANContents

    Private _IBANString As String = ""

    Public Property IBANString() As String
        Get
            Return _IBANString
        End Get
        Set(ByVal Value As String)
            _IBANString = Value
        End Set
    End Property

    Public Sub New(ByVal IBANString As String, ByVal CountryCode As String, _
                   ByVal CheckDigits As String, ByVal BankCode As String, _
                   ByVal BranchCode As String, ByVal AccountNumber As String)
        MyBase.New(CountryCode, CheckDigits, BankCode, BranchCode, AccountNumber)
        _IBANString = IBANString
    End Sub

    Public Overloads Function Equals(ByVal IBAN As IBANContents) As Boolean
        Return (IBAN.AccountNumber = Me.AccountNumber) AndAlso _
               (IBAN.BankCode = Me.BankCode) AndAlso _
               (IBAN.BranchCode = Me.BranchCode) AndAlso _
               (IBAN.CheckDigits = Me.CheckDigits) AndAlso _
               (IBAN.CountryCode = Me.CountryCode)
    End Function

End Class
